USE [paws]
GO

/****** Object:  Table [dbo].[AutoLogouts]    Script Date: 05/30/2012 11:51:50 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[AutoLogouts](
	[ComputerName] [varchar](30) NOT NULL,
	[UserName] [varchar](20) NOT NULL,
	[LogoutTime] [datetime] NOT NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO



USE [paws]
GO

/****** Object:  Table [dbo].[BottomLevelOUs]    Script Date: 05/30/2012 11:52:22 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[BottomLevelOUs](
	[OU] [varchar](900) NOT NULL,
	[Label] [varchar](255) NOT NULL,
	[Lang] [varchar](10) NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[CentralControl]    Script Date: 05/30/2012 11:52:35 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[CentralControl](
	[ControlKey] [varchar](255) NOT NULL,
	[ControlValue] [varchar](255) NULL,
	[LastModified] [datetime] NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[ClientRegistrations]    Script Date: 05/30/2012 11:52:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ClientRegistrations](
	[ID] [bigint] IDENTITY(1,1) NOT NULL,
	[FQDN] [varchar](255) NOT NULL,
	[MACAddress] [varchar](50) NOT NULL,
	[IPAddress] [varchar](50) NULL,
	[LastRegistered] [datetime] NOT NULL,
	[OwnerID] [varchar](255) NULL,
	[Notes] [varchar](255) NULL,
	[Version] [varchar](50) NULL,
 CONSTRAINT [PK_ClientRegistrations] PRIMARY KEY CLUSTERED 
(
	[MACAddress] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[CO2Emissions]    Script Date: 05/30/2012 11:53:02 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[CO2Emissions](
	[CO2PerUnit] [smallint] NOT NULL,
	[FromDate] [datetime] NOT NULL,
	[ToDate] [datetime] NULL
) ON [PRIMARY]

GO


USE [paws]
GO

/****** Object:  Table [dbo].[ComputerConsumptions]    Script Date: 05/30/2012 11:53:20 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ComputerConsumptions](
	[ClientName] [varchar](255) NOT NULL,
	[BaseConsumption] [smallint] NOT NULL,
	[MonitorConsumption] [smallint] NOT NULL,
	[LastModified] [datetime] NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[Domains]    Script Date: 05/30/2012 11:53:34 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Domains](
	[FQDN] [varchar](255) NOT NULL,
	[LDAP] [varchar](255) NULL,
	[StatsRootOU] [varchar](255) NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[ElectricityPrices]    Script Date: 05/30/2012 11:53:45 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ElectricityPrices](
	[UnitPrice] [float] NOT NULL,
	[FromDate] [datetime] NOT NULL,
	[ToDate] [datetime] NULL
) ON [PRIMARY]

GO


USE [paws]
GO

/****** Object:  Table [dbo].[LiveStatsBuildings]    Script Date: 05/30/2012 11:53:57 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LiveStatsBuildings](
	[OrderIndex] [smallint] NOT NULL,
	[GroupingKey] [varchar](100) NOT NULL,
	[GroupingLabel1] [varchar](200) NOT NULL,
	[GroupingLabel2] [varchar](200) NULL,
	[ImagePath] [varchar](200) NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[LiveStatsRooms]    Script Date: 05/30/2012 11:54:12 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[LiveStatsRooms](
	[OU] [varchar](1000) NOT NULL,
	[Label1] [varchar](100) NOT NULL,
	[GroupingKey] [varchar](100) NOT NULL,
	[Label2] [varchar](100) NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[OrganisationSavingStatistics]    Script Date: 05/30/2012 11:54:25 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[OrganisationSavingStatistics](
	[OU] [varchar](750) NOT NULL,
	[Date] [datetime] NOT NULL,
	[SleepTime] [bigint] NOT NULL,
	[CO2Savings] [decimal](18, 2) NOT NULL,
	[CostSavings] [decimal](18, 2) NOT NULL,
	[LastUpdated] [datetime] NOT NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[PawsConfigurations]    Script Date: 05/30/2012 11:54:36 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[PawsConfigurations](
	[ConfigKey] [varchar](255) NOT NULL,
	[ConfigValue] [varchar](255) NULL,
	[ConfigDesc] [varchar](2000) NULL,
	[PAWSClient] [smallint] NULL,
	[PAWSServer] [smallint] NULL,
	[PAWSWeb] [smallint] NULL,
	[PAWSClientManager] [smallint] NULL,
	[PAWSManager] [smallint] NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[PenDriveEvents]    Script Date: 05/30/2012 11:54:50 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[PenDriveEvents](
	[ComputerName] [varchar](255) NULL,
	[UserName] [varchar](255) NULL,
	[LogoutTime] [datetime] NOT NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[PowerEventLogs]    Script Date: 05/30/2012 11:55:01 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[PowerEventLogs](
	[ComputerName] [varchar](255) NOT NULL,
	[EventType] [varchar](50) NOT NULL,
	[EventTime] [datetime] NOT NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[Profiles]    Script Date: 05/30/2012 11:55:12 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Profiles](
	[Filter] [varchar](50) NULL,
	[OU] [varchar](1000) NULL,
	[ID] [bigint] IDENTITY(1,1) NOT NULL,
	[Inheritance] [smallint] NULL,
	[Created] [datetime] NULL,
	[LastModified] [datetime] NULL,
	[CreatedBy] [varchar](255) NULL,
	[LastModifiedBy] [varchar](255) NULL,
	[SleepPeriodStart] [varchar](5) NULL,
	[SleepPeriodEnd] [varchar](5) NULL,
	[IdlePeriod] [smallint] NULL,
	[Days] [varchar](50) NULL,
	[Enabled] [smallint] NULL,
	[SleepMode] [varchar](20) NULL,
	[FQDN] [varchar](255) NULL,
 CONSTRAINT [PK_PAWS_POWERMAN_PROFILES] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[PurgedPowerEventLogs]    Script Date: 05/30/2012 11:55:20 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[PurgedPowerEventLogs](
	[ClientName] [varchar](255) NOT NULL,
	[EventType] [varchar](50) NOT NULL,
	[EventTime] [datetime] NOT NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[RemoteInstalls]    Script Date: 05/30/2012 11:55:30 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[RemoteInstalls](
	[ID] [bigint] IDENTITY(1,1) NOT NULL,
	[FQDN] [varchar](255) NOT NULL,
	[InstallType] [smallint] NOT NULL,
	[Domain] [varchar](255) NOT NULL,
	[Status] [smallint] NOT NULL,
	[RequestTime] [datetime] NOT NULL,
	[LastUpdated] [datetime] NULL,
	[IdleLoggerInstall] [smallint] NULL,
	[JavaInstall] [smallint] NULL,
	[CleanDestFolder] [smallint] NULL,
	[PAWSManagerInstall] [smallint] NULL,
	[PAWSLibsInstall] [smallint] NULL,
	[PAWSConfigInstall] [smallint] NULL,
 CONSTRAINT [PK_RemoteInstalls] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[SavingStatistics]    Script Date: 05/30/2012 11:55:40 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SavingStatistics](
	[OU] [varchar](750) NOT NULL,
	[Date] [datetime] NOT NULL,
	[SleepTime] [bigint] NOT NULL,
	[KwhSavings] [decimal](18, 2) NULL,
	[CO2Savings] [decimal](18, 2) NULL,
	[CostSavings] [decimal](18, 2) NULL,
	[LastUpdated] [datetime] NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[Sessions]    Script Date: 05/30/2012 11:55:51 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Sessions](
	[ComputerName] [varchar](255) NOT NULL,
	[UserName] [varchar](20) NOT NULL,
	[LoginTime] [datetime] NOT NULL,
	[LogoutTime] [datetime] NULL,
	[Language] [varchar](50) NOT NULL,
	[ID] [bigint] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
	[BuildVersion] [varchar](20) NULL,
	[Domain] [varchar](255) NULL,
	[SerialNumber] [varchar](20) NULL,
	[PAWSClientVersion] [varchar](50) NULL,
	[OperatingSystem] [varchar](50) NULL,
 CONSTRAINT [PK_SESSION_LOGGING] PRIMARY KEY CLUSTERED 
(
	[ComputerName] ASC,
	[UserName] ASC,
	[LoginTime] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_SESSION_LOGGING] UNIQUE NONCLUSTERED 
(
	[ComputerName] ASC,
	[UserName] ASC,
	[LoginTime] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[SleepStats]    Script Date: 05/30/2012 11:56:12 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SleepStats](
	[OU] [varchar](750) NOT NULL,
	[Date] [datetime] NOT NULL,
	[SleepTime] [bigint] NOT NULL,
	[KwhSavings] [decimal](18, 2) NULL,
	[CO2Savings] [decimal](18, 2) NULL,
	[CostSavings] [decimal](18, 2) NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [paws]
GO

/****** Object:  Table [dbo].[SleepStatsArchive]    Script Date: 05/30/2012 11:56:21 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SleepStatsArchive](
	[OU] [varchar](750) NOT NULL,
	[Day] [smallint] NOT NULL,
	[Month] [smallint] NOT NULL,
	[Year] [smallint] NOT NULL,
	[SleepTime] [bigint] NOT NULL,
	[KwhSavings] [decimal](18, 2) NULL,
	[CO2Savings] [decimal](18, 2) NULL,
	[CostSavings] [decimal](18, 2) NULL,
 CONSTRAINT [UQ__PAWS_SLEEPSTATS___395884C4] UNIQUE NONCLUSTERED 
(
	[OU] ASC,
	[Day] ASC,
	[Month] ASC,
	[Year] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


